﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using QMERP.Domain.Entities;

namespace QMERP.Infrastructure.EFCore.Mappings
{
    public class PurchaseOrderDetailMapping : IEntityTypeConfiguration<PurchaseOrderDetail>
    {
        public void Configure(EntityTypeBuilder<PurchaseOrderDetail> builder)
        {
            builder.Property(x => x.PurchaseOrderId);
            builder.Property(x => x.SupplierId);
            builder.Property(x => x.WarehouseId);
            builder.Property(x => x.LensId);

            builder.HasIndex(x => x.Id);
            builder.HasIndex(x => x.PurchaseOrderId);
            builder.HasIndex(x => x.SupplierId);
            builder.HasIndex(x => x.WarehouseId);
            builder.HasIndex(x => x.LensId);
        }
    }
}
